package com.ktgj.customer.service.impl;

import java.util.List;
import com.ktgj.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktgj.customer.mapper.MallOrderProductMapper;
import com.ktgj.customer.domain.MallOrderProduct;
import com.ktgj.customer.service.IMallOrderProductService;

/**
 * 订单商品Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-05-30
 */
@Service
public class MallOrderProductServiceImpl implements IMallOrderProductService 
{
    @Autowired
    private MallOrderProductMapper mallOrderProductMapper;

    /**
     * 查询订单商品
     * 
     * @param orderProductId 订单商品ID
     * @return 订单商品
     */
    @Override
    public MallOrderProduct selectMallOrderProductById(Long orderProductId)
    {
        return mallOrderProductMapper.selectMallOrderProductById(orderProductId);
    }

    /**
     * 查询订单商品列表
     * 
     * @param mallOrderProduct 订单商品
     * @return 订单商品
     */
    @Override
    public List<MallOrderProduct> selectMallOrderProductList(MallOrderProduct mallOrderProduct)
    {
        return mallOrderProductMapper.selectMallOrderProductList(mallOrderProduct);
    }

    /**
     * 新增订单商品
     * 
     * @param mallOrderProduct 订单商品
     * @return 结果
     */
    @Override
    public int insertMallOrderProduct(MallOrderProduct mallOrderProduct)
    {
        mallOrderProduct.setCreateTime(DateUtils.getNowDate());
        return mallOrderProductMapper.insertMallOrderProduct(mallOrderProduct);
    }

    /**
     * 修改订单商品
     * 
     * @param mallOrderProduct 订单商品
     * @return 结果
     */
    @Override
    public int updateMallOrderProduct(MallOrderProduct mallOrderProduct)
    {
        mallOrderProduct.setUpdateTime(DateUtils.getNowDate());
        return mallOrderProductMapper.updateMallOrderProduct(mallOrderProduct);
    }

    /**
     * 批量删除订单商品
     * 
     * @param orderProductIds 需要删除的订单商品ID
     * @return 结果
     */
    @Override
    public int deleteMallOrderProductByIds(Long[] orderProductIds)
    {
        return mallOrderProductMapper.deleteMallOrderProductByIds(orderProductIds);
    }

    /**
     * 删除订单商品信息
     * 
     * @param orderProductId 订单商品ID
     * @return 结果
     */
    @Override
    public int deleteMallOrderProductById(Long orderProductId)
    {
        return mallOrderProductMapper.deleteMallOrderProductById(orderProductId);
    }
}
